package com.zhouxiaoge.queue.priority;

import java.util.concurrent.PriorityBlockingQueue;

/**
 * @author 周小哥  gqzmy@163.com 2022/11/18 20:53
 */

public class PriorityBlockingQueueTest {
    public static void main(String[] args) {
        PriorityBlockingQueue<Person> personPriorityBlockingQueue = new PriorityBlockingQueue<>();
        personPriorityBlockingQueue.add(new Person(1L, "A"));
        System.out.println(personPriorityBlockingQueue);
        personPriorityBlockingQueue.add(new Person(3L, "C"));
        System.out.println(personPriorityBlockingQueue);
        personPriorityBlockingQueue.add(new Person(2L, "B"));
        System.out.println(personPriorityBlockingQueue);
        personPriorityBlockingQueue.add(new Person(4L, "D"));
        System.out.println(personPriorityBlockingQueue);
    }
}
